package jmine.tec.utils.reflection.fast.asm;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import jmine.tec.utils.reflection.fast.FastMethodNoArgs;

/**
 * @author takeshi
 */
public class FastMethodNoArgImpl extends FastMethodImpl implements FastMethodNoArgs {

    /**
     * C'tor
     * 
     * @param index o indice
     * @param method o {@link Method}
     * @param gen o accessor
     */
    public FastMethodNoArgImpl(int index, Method method, GeneratedFastClassAccessor gen) {
        super(index, method, gen);
    }

    /**
     * {@inheritDoc}
     */
    public Object invokeNoArgs(Object target) throws InvocationTargetException {
        try {
            return this.generated.invokeMethodNoArgs(this.index, target);
        } catch (RuntimeException e) {
            throw e;
        } catch (Error e) {
            throw e;
        } catch (Exception e) {
            throw new InvocationTargetException(e);
        }
    }

}
